package com.muchfish.reactor.api;

import reactor.core.publisher.Flux;
import java.time.Duration;

public class ReactorIntervalExample {
    public static void main(String[] args) throws InterruptedException {
        Flux.interval(Duration.ofSeconds(1))
                .take(5) // 限制产生的元素数量
                .subscribe(System.out::println);

        Thread.sleep(233333);
    }
}
